home *** CD-ROM | disk | FTP | other *** search
/ Turnbull China Bikeride / Turnbull China Bikeride - Disc 2.iso / STUTTGART / GRAPHICS / TOOLS / MPEGENCODE / Manual next >
Text File  |  1993-09-12  |  9KB  |  276 lines

  1.  
  2.                 MPEG-1 Video Software Encoder
  3.                  (Version 1.1; August 9, 1993)
  4.  
  5.                      RISC OS Version 1.0
  6.  
  7. Loek Frederiks
  8. Runmolen 88A
  9. 1823 GM Alkmaar
  10. The Netherlands
  11. +31-072-111551
  12.  
  13. This manual is meant for the RISC OS version of the Berkeley MPEG-1 Video
  14. Software Encoder.
  15.     
  16. Synopsis
  17. --------
  18.  
  19. mpeg_encod [-stat stat_file] [-quiet num_seconds] [-no_frame_summary]
  20.            [-gop gop_num] [-combine_gops] [-frames first_frame last_frame]
  21.            [-combine_frames] [-snr] param_file
  22.  
  23. Description
  24. -----------
  25.  
  26. Produces an MPEG-1 video stream. param_file is a parameter file which
  27. includes a list of input files and other parameters. The file is described
  28. in detail below. The -gop, -combine_gops, -frames, and -combine_frames
  29. options are all exclusive.
  30.  
  31. Options
  32. -------
  33.   
  34.   -stat stat_file
  35.  
  36. Causes the encoder to append the statistics to the file stat_file. In any
  37. case, the statistics are output to stdout. The statistics use the following
  38. abbreviations: bits per block (bpb), bits per frame (bpf), seconds per
  39. frame (spf), and bits per second (bps).
  40.  
  41.   -quiet num_seconds
  42.  
  43. Causes the program to not report remaining time for at least num_seconds
  44. seconds. A negative values tells the program not to report at all. 0 is
  45. the default (reports once after each frame). Note that the time remaining
  46. is an estimate and does not take into account time to read in frames.
  47.  
  48.   -no_frame_summary
  49.  
  50. Prevents the program from printing a summary line for each frame
  51.  
  52.   -gop gop_num
  53.  
  54. Causes the encoder to only encode the numbered GOP (first GOP is 0). The
  55. parameter file is the same as for normal usage. The output file will be
  56. the normal output file with the suffix ".gop.<gop_num>" No sequence info
  57. is output.
  58.  
  59.   -combine_gops
  60.  
  61. Causes the encoder to simply combine some GOP files into a single MPEG
  62. stream. A sequence header/ender are inserted. In this case, the parameter
  63. file need only contain the YUV_SIZE value, an output file, and perhaps a
  64. list of input GOP files (see below).
  65.  
  66.   -frames first_frame last_frame
  67.  
  68. Causes the encoder to only encode the frames from first_frame to
  69. last_frame, inclusive. The parameter file is the same as for normal usage.
  70. The output will be placed in separate files, one per frame, with the file
  71. names being the normal output file with the suffix ".frame.<frame num>" No
  72. GOP header information is output. Thus, the parameter file need not include
  73. the GOP_SIZE value.
  74.  
  75.   -combine_frames
  76.  
  77. Causes the encoder to simply combine some frames into a single MPEG stream.
  78. Sequence and GOP headers are inserted appropriately. In this case, the
  79. parameter file need only contain the YUV_SIZE value, the GOP_SIZE value,
  80. an output file, and perhaps a list of frame files (see below).
  81.  
  82.   -snr
  83.  
  84. Print the signal-to-noise ratio. Prints SNR (Y U V) and peak SNR (Y U V)
  85. for each frame. In summary, prints averages of luminance only (Y). SNR is
  86. defined as 10*log(variance of original/variance of error). Peak SNR is
  87. defined as 20*log(255/RMSE). Note that the encoder will run a little slower
  88. if you want it to print the SNR.
  89.  
  90. Parameter file
  91. --------------
  92.  
  93. The parameter file MUST contain the following lines (except when using the
  94. -combine_gops or -combine_frames options):
  95.  
  96.   PATTERN <pattern>
  97.  
  98.   OUTPUT <output file>
  99.  
  100.   INPUT_DIR <directory>
  101.  
  102. all input files must reside in this directory. If you want to refer to the
  103. current directory, use '.' (an empty INPUT_DIR value would refer to the root
  104. directory).
  105.  
  106.   INPUT
  107.  
  108. This line must be followed by a list of the input files (in display order)
  109. and then the line
  110.  
  111.   END_INPUT
  112.  
  113. There are three types of lines between INPUT and END_INPUT. First, a line
  114. may simply be the name of an input file. Secondly, the line may be of the
  115. form
  116.  
  117.   <single_star_expr> [x-y]
  118.  
  119. single_star_expr can have a single '*' in it. It is replaced by all the
  120. numbers between x and y inclusive. So, for example, the line
  121.  
  122.   tennis*.ppm [12-15]
  123.  
  124. is replaced by tennis12.ppm, tennis13.ppm, tennis14.ppm, tennis15.ppm.
  125. Uniform zero-padding occurs, as well. For example, the line
  126.  
  127.   football.*.ppm [001-130]
  128.  
  129. is replaced by football.001.ppm, football.002.ppm, ..., football.009.ppm,
  130. football.010.ppm, ..., football.130.ppm. The third type of line is:
  131.  
  132.   <single_star_expr> [x-y+s]
  133.  
  134. Where the line is treated exactly as above, except that we skip by s. Thus,
  135. the line
  136.  
  137.   football.*.ppm [001-130+4]
  138.  
  139. is replaced by football.001.ppm, football.005.ppm, football.009.ppm,
  140. football.013.ppm, etc.
  141.  
  142.   BASE_FILE_FORMAT <YUV or PPM or PNM>
  143.  
  144. All the input files must be converted to YUV, PNM or PPM format. This line
  145. specifies which of the three formats (actually PPM is a subset of PNM).
  146. In the YUV format, the U and V components are subsampled 4:1. The reason
  147. for having a separate PPM option is for simplicity. If your files are
  148. RAWBITS ppm files, then use the PPM option rather than the PNM. Also,
  149. depending on the system, file reads will go much faster with the PPM
  150. option (as opposed to PNM).
  151.  
  152.   INPUT_CONVERT <conversion command>
  153.  
  154. You must specify how to convert a file to the base file format. In the
  155. conversion command, each '*' is replaced by the filename (the items listed
  156. between INPUT and END_INPUT). If no conversion is necessary, then you would
  157. just say:
  158.  
  159.   INPUT_CONVERT *
  160.  
  161. If you had a bunch of gif files, you might say:
  162.  
  163.   INPUT_CONVERT giftoppm *
  164.  
  165. If you have a bunch of separate a.Y, a.U, and a.V files, then you might say:
  166.  
  167.   INPUT_CONVERT cat *.Y *.U *.V
  168.  
  169.   GOP_SIZE <n>
  170.  
  171. n is roughly the number of frames in a Group of Pictures (roughly because
  172. a GOP must begin with an I-frame)
  173.  
  174.   SLICES_PER_FRAME <n>
  175.  
  176. n is roughly the number of slices per frame. Note, at least one MPEG player
  177. may complain if slices do not start at the left side of an image.
  178. To ensure this does not happen, make sure the number of rows is divisible
  179. by SLICES_PER_FRAME.
  180.  
  181.   PIXEL <FULL or HALF>
  182.  
  183. Use half-pixel motion vectors, or only full-pixel ones.
  184.  
  185.   RANGE <n>
  186.  
  187. Use a search range of +/- n pixels.
  188.  
  189.   PSEARCH_ALG <algorithm>
  190.  
  191. Algorithm must be one of {EXHAUSTIVE, TWOLEVEL, SUBSAMPLE, LOGARITHMIC}.
  192. Tells what kind of search procedure should be used for P-frames. Exhaustive
  193. gives the best compression, but logarithmic is the fastest. You select the
  194. desired combination of speed and compression. TWOLEVEL is an exhaustive
  195. full-pixel search, followed by a local half-pixel search around the best
  196. full-pixel vector (the PIXEL option is ignored for this search algorithm).
  197.  
  198.   BSEARCH_ALG <algorithm>
  199.  
  200. Algorithm must be one of {SIMPLE, CROSS2, EXHAUSTIVE}. Tells what kind of
  201. search procedure should be used for B-frames. Simple means find best
  202. forward and backward vectors, then interpolate. Cross2 means find those two
  203. vectors, then see what backward vector best matches the best forward vector, and vice versa. Exhaustive does an n-squared search and is EXTREMELY slow
  204. in relation to the others (Cross2 is about twice as slow as Simple).
  205.  
  206.   IQSCALE <n>
  207.  
  208. Use n as the qscale for I-frames.
  209.  
  210.   PQSCALE <n>
  211.  
  212. Use n as the qscale for P-frames.
  213.  
  214.   BQSCALE <n>
  215.  
  216. Use n as the qscale for B-frames.
  217.  
  218.   REFERENCE_FRAME <ORIGINAL or DECODED>
  219.  
  220. If ORIGINAL is specified, then the original images are used when computing
  221. motion vectors. To be more accurate, use DECODED, in which the decoded
  222. images are used. This should increase the quality of the image, but will
  223. take a bit longer to encode.
  224.  
  225. Notes
  226. -----
  227.  
  228. If the BASE_FILE_FORMAT is YUV, then the parameter file must contain:
  229.  
  230.   YUV_SIZE <w>x<h>
  231.  
  232. where w = width, h = height (in pixels) of image
  233.  
  234. If the -combine-gops option is used, then only the YUV_SIZE and OUTPUT
  235. values need be specified in the parameter file. In addition, the parameter
  236. file may specify input GOP files in the same manner as normal input
  237. files -- except instead of using INPUT_DIR, INPUT, and END_INPUT, use 
  238. GOP_INPUT_DIR, GOP_INPUT, and GOP_END_INPUT. If no input GOP files are
  239. specified, then the default is to use the output file name with suffix 
  240. ".gop.<gop_num>" starting from 0 as the input files.
  241.  
  242. If the -combine-frames option is used, then only the YUV_SIZE, GOP_SIZE, and
  243. OUTPUT values need be specified in the parameter file. In addition, the
  244. parameter file may specify input frame files in the same manner as normal
  245. input files -- except instead of using INPUT_DIR, INPUT, and END_INPUT, use
  246. FRAME_INPUT_DIR, FRAME_INPUT, and FRAME_END_INPUT. If no input frame files
  247. are specified, then the default is to use the output file name with
  248. suffix ".frame.<frame_num>" starting from 0 as the input files.
  249.  
  250. Any number of spaces and tabs may come between each option and value. Lines
  251. beginning with '#' are ignored. Any other lines are ignored except for
  252. those between INPUT and END_INPUT.  This allows you to use the same
  253. parameter file for normal usage and for -combine_gops and -combine_frames.
  254.  
  255. The encoder is case-sensitive so, except for file names and directories,
  256. everything should be in upper case.
  257.  
  258. The lines may appear in any order, except the following exceptions. INPUT
  259. must appear before END_INPUT (also, GOP_INPUT before GOP_END_INPUT and
  260. FRAME_INPUT before FRAME_END_INPUT). All lines between INPUT and END_INPUT
  261. must be the frames in play order.
  262.  
  263. Authors
  264. -------
  265.  
  266. Kevin Gong  - University of California, Berkeley, keving@cs.berkeley.edu
  267.  
  268. Ketan Patel - University of California, Berkeley, kpatel@cs.berkeley.edu
  269.  
  270. Dan Wallach - University of California, Berkeley, dwallach@cs.berkeley.edu
  271.  
  272. Bugs
  273. ----
  274.  
  275. No known bugs.
  276.